package com.beiding.t;

/**
 * 重新计算
 */
public class Recale {

//    public static void main(String[] args) {
//
//        //1 查询出商品详情
////        Analyzer orderinfo = request("/omp-event-webin/rest?method=OrderSave.orderinfo&ent_id=0", Analyzer.read("{\n" +
////                "    \"billno\":\"16316763400081\"\n" +
////                "}"));
////        Analyzer detail = orderinfo.getAnalyzer("data.bill_detail");
//
//
//        Analyzer detail = Analyzer.read("{\"billno\":\"16316812472801\"}");
//
//        JSONObject user = JSONObject.parseObject(
//                "{\"consumers_id\": \"9800258136007\"}");
//
//        user.forEach((k, v) -> {
//            detail.set(k, v);
//        });
//
//
//        Analyzer analyzer = Analyzer.read("{ \"calc_mode\": \"RECALC\"}");
//        analyzer.set("bill_detail", detail);
//
//        System.out.println(analyzer.format());
//
//        Analyzer r = request("/omp-event-webin/rest?method=efuture.omp.event.coupongain.calc&ent_id=0", analyzer);
//
//        System.out.println(r.format());
//
//    }
//
//    private static Analyzer request(String path, Analyzer body) {
//        String base = "http://localhost:8080";
//        path = base + path;
//        RestTemplate restTemplate = new RestTemplate();
//        HttpHeaders httpHeaders = new HttpHeaders();
//        HttpEntity<String> entity = new HttpEntity<>(body.getContent(JSON.class).toJSONString(), httpHeaders);
//        String jsonObject = restTemplate.postForObject(path, entity, String.class);
//        return Analyzer.read(jsonObject);
//    }


}
